<template>
  <swiper ref="mySwiper" :options="swiperOptions" class="home-banner">
    <swiper-slide v-for="(item, index) in slide" :key="index">
      <img :src="item.cover" />
    </swiper-slide>
    <div class="swiper-pagination" slot="pagination"></div>
  </swiper>
</template>

<script>
export default {
  name: 'Banner',
  props: {
    slide: {
      type: Array,
      default: () => []
    }
  },
  data () {
    return {
      swiperOptions: {
        pagination: {
          el: '.swiper-pagination'
        }
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.home-banner {
  img {
    @include wh(100%, auto);
  }
  .swiper-pagination {
    /deep/.swiper-pagination-bullet {
      @include wh(16px, 16px);
      display: inline-block;
      &.swiper-pagination-bullet-active {
        background: $base-color;
      }
    }
  }
}
</style>
